<?php

namespace App\Models;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class ReturnLog
 * @package App\Models
 * @version September 20, 2017, 11:13 am CST
 *
 * @property integer type
 * @property integer order_id
 * @property integer goods_id
 * @property integer attribute_id
 * @property integer status
 */
class ReturnLog extends Model
{
    use SoftDeletes;

    public $table = 'return_logs';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'type',
        'order_id',
        'orderGoods_id',
        'goods_id',
        'response',
        'price',
        'attribute_id',
        'number',
        'status'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'type' => 'integer',
        'order_id' => 'integer',
        'goods_id' => 'integer',
        'attribute_id' => 'integer',
        'status' => 'integer'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    public function order()
    {
        return $this->belongsTo('App\Models\Order');
    }

    public function goods()
    {
        return $this->belongsTo('App\Models\Goods');
    }

    public function attribute()
    {
        return $this->belongsTo('App\Models\GoodsAttribute','attribute_id');
    }
}
